/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.bean.CompanyInfo;
/*    */ import com.newcrm.bean.User;
/*    */ import com.newcrm.db.GroupManager;
/*    */ import com.newcrm.db.UserManager;
/*    */ import com.newcrm.exception.DBException;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.sql.SQLException;
/*    */ import javax.servlet.RequestDispatcher;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import org.apache.log4j.Logger;
/*    */ 
/*    */ public class ListGroups extends AbstractAction
/*    */ {
/* 23 */   private static Logger logger = Logger.getLogger(ListGroups.class.getName());
/*    */ 
/*    */   public ListGroups(AbstractHttpServlet servlet) {
/* 26 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 36 */     User user = super.getLoginUser(request);
/*    */ 
/* 38 */     GroupManager manager = new GroupManager();
/*    */ 
/* 40 */     CompanyInfo company = super.getCompany(request);
/*    */     try
/*    */     {
/* 43 */       company.setGroups(manager.list(user.companyId));
/*    */     } catch (DBException e) {
/* 45 */       logger.warn("get group list failed", e);
/*    */     } catch (SQLException e) {
/* 47 */       logger.warn("get group list failed", e);
/*    */     }
/*    */ 
/* 51 */     UserManager userManager = new UserManager();
/* 52 */     company.users = userManager.getCompanyUsers(user.companyId, null);
/*    */ 
/* 54 */     request.getRequestDispatcher("/groupManager.jsp").forward(request, 
/* 55 */       response);
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.ListGroups
 * JD-Core Version:    0.6.1
 */